package net.realsee.service.wcs.warehouse;

import com.baomidou.mybatisplus.extension.service.IService;
import net.realsee.common.enums.wcs.charact.WcsCharactEnum;
import net.realsee.domain.wcs.data.bo.WcsUnitCharactBo;
import net.realsee.domain.wcs.warehouse.WcsWarehouseLocation;
import net.realsee.domain.wcs.warehouse.bo.LocationFullInfoBo;
import net.realsee.domain.wcs.warehouse.bo.WcsWarehouseLocationBo;
import net.realsee.domain.wcs.warehouse.vo.WcsWarehouseLocationVo;
import net.realsee.framework.core.domain.PageQuery;
import net.realsee.framework.core.page.TableDataInfo;
import net.realsee.gcl.domain.bo.ccs.GclCcsOperateResult;
import net.realsee.gcl.domain.bo.ccs.GclCcsRequestParams;

import java.util.Collection;
import java.util.List;

/**
 * 库位Service接口
 *
 * @author realsee
 * @date 2023-08-11
 */
public interface IWcsWarehouseLocationService extends IService<WcsWarehouseLocation> {

    /**
     * 查询库位
     */
    WcsWarehouseLocationVo selectVoById(Long id);

    /**
     * 查询库位列表
     */
    TableDataInfo<WcsWarehouseLocationVo> selectVoPage(WcsWarehouseLocationBo bo, PageQuery pageQuery);

    /**
     * 查询库位列表
     */
    List<WcsWarehouseLocationVo> selectVoList(WcsWarehouseLocationBo bo);

    /**
     * 新增库位
     */
    Boolean insertByBo(WcsWarehouseLocationBo bo);

    /**
     * 修改库位
     */
    Boolean updateByBo(WcsWarehouseLocationBo bo);

    /**
     * 校验并批量删除库位信息
     */
    Boolean deleteWithValidByIds(Collection<Long> ids);

    /**
     * 通过库位查询库位信息
     */
    WcsWarehouseLocation getByLocation(String location);

    WcsWarehouseLocation getByMapMark(String mapMark);

    WcsWarehouseLocation getByWaitMapMark(String waitMapMark);

    /**
     * 通过库位查询库位完整信息
     */
    LocationFullInfoBo getFullInfoByLocation(String location);

    /**
     * 根据库位编号更新库位状态
     *
     * @param location
     * @param status
     */
    void updateWarehouseStatus(String location, Integer status);

    /**
     * 根据库位编号、任务号，查询该库位的任务状态
     *
     * @param requestParams
     * @return
     */
    GclCcsOperateResult queryWarehouseLocTaskStatus(GclCcsRequestParams requestParams);

    /**
     * 根据库位查询传感器距离
     *
     * @param location
     * @return
     */
    List<WcsUnitCharactBo> getSensorDistance(String location);

    /**
     * 通过库位号和特性，查询特性值
     */
    String getValueByLocationAndCharact(String location, WcsCharactEnum wcsCharactEnum);
}
